package com.twu.biblioteca;

import java.io.IOException;
import java.util.ArrayList;

/**
 * Created by ecchilds on 3/13/14.
 */
public class Catalog {

    private ArrayList<Book> libraryBooks;
    private Out out;
    private UserIn userIn;

    public Catalog(ArrayList<Book> libraryBooks, Out out, UserIn userIn){

        this.libraryBooks = libraryBooks;
        this.out = out;
        this.userIn = userIn;
    }


    public void printBooks() {

        out.printList("Books:", libraryBooks);
    }

    public void checkOut(int bookNum) {

        libraryBooks.remove(bookNum);

    }

    public int promptUserForBook() throws IOException {
        return userIn.getValidInputGivenRange("Book", libraryBooks.size());
    }
}
